<?php
header('content-type:text/html;charset=utf-8');
header('Access-Control-Allow-Origin:*');//解决后端跨域问题

$server = 'localhost:3306';
$username = $password = 'root';
$dbname = 'mall2004';

// $server = 'b-yea1chiklum2rh.bch.rds.gz.baidubce.com:3306';
// $username = 'b_yea1chiklum2rh';
// $password = 'wjp268hh';
// $dbname = 'b_yea1chiklum2rh';

$conn = mysqli_connect($server, $username, $password, $dbname);

if(!$conn){
    die('数据库连接失败');
}